/**
 * Created by Administrator on 2018/5/17 0017.
 */
//打开（下载）App
function openApp(){
  var ua = window.navigator.userAgent.toLowerCase();
  //微信
  if(ua.match(/MicroMessenger/i) == 'micromessenger'){
    window.location.href='downLoadForPhone';
  }else{//非微信浏览器
    if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
      var loadDateTime = new Date();
      window.setTimeout(function() {
        var timeOutDateTime = new Date();
        if (timeOutDateTime - loadDateTime < 5000) {
          window.location = "";//ios下载地址
        } else {
          window.close();
        }
      },2000);
      window.location = "schema://";
    }else if (navigator.userAgent.match(/android/i)) {
      var state = null;
      try {
        window.location = 'schema://';
        setTimeout(function(){
          window.location= ""; //android下载地址
          
        },500);
      } catch(e) {}
    }
  }
}